package hn.cch.spring_boot_security_rest.constant;

/**
 * 返回码
 */
// 处理枚举类型转JSON只取第一个属性
// @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum StatusCode {
    SUCCESS("1000", "成功"),
    FAILURE("9999", "未知错误"),

    PLEASE_LOGIN("2001", "请登录"),
    NO_PERMISSION("2002", "无权限"),

    USER_NOT_EXIST("3001", "用户不存在"),

    PASSWORD_ERROR("3002", "密码错误"),
    PASSWORD_EXPIRED("3003", "密码过期"),

    ACCOUNT_DISABLE("3004", "账户已停用"),
    ACCOUNT_EXPIRED("3005", "账户已过期"),
    ACCOUNT_LOCKED("3006", "账户已锁定"),
    ACCOUNT_OFFLINE("3007", "账户已下线"),

    ;

    private String code;
    private String info;


    StatusCode() {
    }

    StatusCode(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }
}
